//
//  YMTestReportIntroduceCell.m
//  YMMedical
//
//  Created by y s on 2023/7/21.
//

#import "YMTestReportIntroduceCell.h"
#import "YMMedicalTools.h"

@interface YMTestReportIntroduceCell ()

@property (nonatomic, strong) UIView *vBg;
@property (nonatomic, strong) UILabel *lblContent;

@end

@implementation YMTestReportIntroduceCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setUI];
    }
    return self;
}

#pragma mark - UI methods
- (void)setUI{
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.contentView.backgroundColor = [UIColor clearColor];
    self.backgroundColor = [UIColor clearColor];
    
    [self.contentView addSubview:self.vBg];
    [self.vBg addSubview:self.lblContent];
    
    [self.vBg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(0);
        make.left.mas_equalTo([SFitUtil fit:15]);
        make.right.mas_equalTo([SFitUtil fit:-15]);
    }];
    [self.lblContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo([SFitUtil fit:15]);
        make.left.mas_equalTo([SFitUtil fit:15]);
        make.right.mas_equalTo([SFitUtil fit:-15]);
        make.bottom.mas_equalTo([SFitUtil fit:-15]);
    }];
}

#pragma mark - public methods
- (void)setStrText:(NSString *)strText{
    _strText = strText;
    if (strText != nil && strText.length > 0){
        self.lblContent.attributedText = [YMMedicalTools getHtmlStringWithString:strText];
    }else{
        self.lblContent.text = @"";
    }
}

#pragma mark - Event Action


#pragma mark - setter and getter
- (UIView *)vBg{
    if (_vBg == nil){
        _vBg = [[UIView alloc] init];
        _vBg.clipsToBounds = YES;
        _vBg.layer.cornerRadius = [SFitUtil fit:8];
        _vBg.backgroundColor = STheme.D9;
    }
    return _vBg;
}
- (UILabel *)lblContent{
    if (_lblContent == nil){
        _lblContent = [SThemeUtil label:@"" color:STheme.H_D3 fontSize:13];
        _lblContent.numberOfLines = 0;
    }
    return _lblContent;
}


@end
